package com.gxc.mall.goods.feign;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author GongXincheng
 * @since 2019-09-03 17:50
 */
@Component
public class UserFeignFallbackFactory implements FallbackFactory<UserFeign> {

    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public String hello() {
                throwable.printStackTrace();
                return "ERROR";
            }

            @Override
            public Object hello2() {
                throwable.printStackTrace();
                return "ERROR";
            }

            @Override
            public Object hello3(String name) {
                throwable.printStackTrace();
                return "ERROR";
            }
        };
    }
}
